package model.service;

import java.util.Date;

import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.SimpleTrigger;
import org.quartz.impl.StdSchedulerFactory;

public class SchedulerTask {

	
  public SchedulerTask()throws Exception{
	
	  SchedulerFactory sf=new StdSchedulerFactory();
	  Scheduler sched=sf.getScheduler();
	  sched.start();
	  JobDetail jd=new JobDetail("myjob",Scheduler.DEFAULT_GROUP,ChubJob.class);
	  SimpleTrigger st=new SimpleTrigger("mytrigger",Scheduler.DEFAULT_GROUP,new Date(),null,SimpleTrigger.REPEAT_INDEFINITELY, 15L * 60L * 1000L);
	  sched.scheduleJob(jd, st); 
  
  }

}
